You use the Action Recorder
to record commands and input values for an action macro.
While
recording an action macro, the Red Recording Circle icon is displayed near
the crosshairs to indicate that the Action Recorder is active and
that commands and input are being recorded.
While recording, commands
and input that is entered at the command line are recorded with
the exception of commands that open or close drawing files. If a
dialog box is displayed while recording an action macro, only the display
of the dialog box is recorded and not the changes made to the dialog box.
It is recommended that you do not use dialog boxes when recording
an action macro. Use the command line version of the command instead.
For example, use the -HATCH command instead of the HATCH command, which
displays the Hatch and Gradient dialog box.
Once you are done recording
an action macro, you then have the option to save or discard the
recorded action macro. If you save the action macro, you must specify
a name and optionally, a description and the playback settings for
the action macro. The playback settings control if the view prior
to the playback of the action macro is restored when a request for
user input is made or when playback is complete.
When the Action Recorder
is set to check for inconsistencies, it compares the settings of
the drawing environment when the action macro was recorded against
the current settings of the drawing environment. For example, the Action
Recorder checks the value of the INSUNITS system variable in the
current drawing against the value that was used when the action
macro was recorded. If an inconsistency is found, you are given
the option to continue playing back the action macro or to stop
playback. If you continue playing back the action macro, the action
macro might produce unexpected results.
Show Me: Record an Action
Macro
Use Action Macros while
Recording
You can play back an
action macro while you are recording an action macro; you can combine
multiple action macros together to create a new action macro. To
use an existing action macro while recording another action macro,
the action macro that you want to play back needs to be present
in one of the paths defined by the system variables ACTPATH or ACTRECPATH. If the action
macro is in one of the defined paths, enter the name of the action
macro at the Command prompt to play it back.
Use Custom Commands and
Routines with Action Macros
When recording commands
and input, you can use the standard commands that come with AutoCAD and
other custom commands that you might already use. The custom commands
that you can use is not limited to just commands defined with AutoLISP
or ObjectARX, but also includes commands defined with .NET and macros
defined with VBA.
Before playing back an
action macro that contains references to custom commands and macros,
the original programs that define the commands and macros must be
loaded into AutoCAD in order for the action macro to be played
back correctly. To make sure the custom commands are available when
an action macro is played back, you can use one or more of the following.
- Startup Suite -
The Start Up Suite in the Load/Unload Applications dialog box can
be used to load files that contain custom commands.
- ACAD.lsp or ACADDOC.lsp
File - The acad.lsp or acaddoc.lsp file
can be used to automatically load files that contain custom commands.
- Menu AutoLISP (MNL) File -
A MNL file can be used to load files that contain custom commands
specific to a CUIx file.
- Customization User Interface
(CUIx) File - AutoLISP files that define custom commands
can be associated to a CUIx file by adding them to the LISP node
in the CUI Editor.
- Script Files -
A script file can be used to load AutoLISP, ObjectARX, VBA, or .NET
files. To record the running of a script file, set FILEDIA to 0
before using the SCRIPT command.
Store Recorded Action Macros
When you stop the recording of an action macro,
you have the option to save the recorded action macro. If you save
the recorded action macro, the command name specified for the action
macro is also used as the file name of the action macro. The saved
action macro is stored in the folder defined by the ACTRECPATH system variable.
You can access the folder in the Options dialog box.
To start recording an action
macro
- On the ribbon, click Manage tab
Action Recorder panel
Record.
- Use the commands and provide the input
that is needed to complete the task that you want to automate.
To stop the recording of
an action macro
- On the ribbon, click Manage tab
Action Recorder panel
Stop.
- In the Action Macro dialog box, enter
a name in the Action Macro Command Name text box.
- Optionally, do the following:
- Enter a description for the action macro
in the Description text box.
- Under Restore Pre-playback View, select
When Pausing for User Input to restore the view prior to the playback
of the action macro.
- Under Restore Pre-playback View, select
Once Playback Finishes to restore the view prior to the playback
of the action macro.
- Select Check for Inconsistencies when
Playback Begins to have the Action Recorder validate the action
macro before playback.
- Click OK.
To cancel the recording
of an action macro
- On the ribbon, click Manage tab
Action Recorder panel
Stop.
- In the Action Macro dialog box, click
Cancel.
To copy an action macro
to create a new action macro
- On the ribbon, click Manage tab
Action Recorder panel.
Click the down arrow next to the Action Macro list.
- In the Action Macro list, select the
action macro you want to copy.
- Expand the Action Recorder panel.
- In the Action tree, right-click the top
node and click Copy.
- In the Action Macro dialog box, enter
a name in the Action Macro Name text box.
- Optionally, do the following:
- Enter a command name for the action macro
in the Action Macro Command Name text box.
- Enter a description for the action macro
in the Description text box.
- Under Restore Pre-playback View, select
When Pausing for User Input to restore the view prior to the playback
of the action macro.
- Under Restore Pre-playback View, select
Once Playback Finishes to restore the view prior to the playback
of the action macro.
- Select Check for Inconsistencies when
Playback Begins to have the Action Recorder validate the action
macro before playback.
- Click OK.
To change the location
used to save a recorded action macro
- On the menu browzer, click Options.
- In the Options dialog box, Files tab,
in the list of nodes, click the plus sign (+) next to Action Recorder
Settings.
- Click the plus sign (+) next to Actions
Recording File Locations, and specify a folder path.
- Click OK.
CommandsACTRECORD
Starts
the Action Recorder.
ACTSTOP
Stops
the Action Recorder and provides the option of saving the recorded actions
to an action macro file.
OPTIONS
Customizes the program
settings.
RIBBON
System VariablesACTPATH
Specifies the additional
paths to use when locating available action macros for playback.
ACTRECORDERSTATE
Specifies the current
state of the Action Recorder.
ACTRECPATH
Specifies the path used
to store new action macros.